From: Jo-Philipp Wich Date: Fri, 10 Jan 2020 21:12:03 +0000 (+0100) Subject: luci-base: dispatcher: remove empty firstchild nodes from menu X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22http:/www.crowdsec.net/%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22?a=commitdiff_plain;h=fd7961337f44ebe8aa71e6ae0925cb70a8c53b21;p=project%2Fluci.git luci-base: dispatcher: remove empty firstchild nodes from menu Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua index 8dac8d6b6e..48e125e4ae 100644 --- a/modules/luci-base/luasrc/dispatcher.lua +++ b/modules/luci-base/luasrc/dispatcher.lua @@ -623,6 +623,14 @@ local function merge_trees(node_a, node_b) node_a[k] = v end end + + if type(node_a.action) == "table" and + node_a.action.type == "firstchild" and + node_a.children == nil + then + node_a.satisfied = false + end + return node_a end